Visualizing Data Structures by Hoenigman Rhonda

Visualizing Data Structures by Hoenigman Rhonda

Author:Hoenigman, Rhonda
Language: eng
Format: epub
ISBN: 9781329133020
Publisher: Lulu.com
Published: 2015-09-01T16:00:00+00:00


2. Evaluate the next value in the list, 2. Since 2 < 4, go left of the root and add the 2 to the tree as the left child of the 4.

3. Evaluate the next value in the list, 6. Since 6 > 4, go right of the root and add the 6 to the tree as the right child of the 4. The partial tree containing the first three nodes added is shown in Figure 2.

Figure 2. BST after the first three nodes are added. The root is 4, the left child of the root is 2 and the right child of the root is 6.

4. Evaluate the next value in the list, 9. Since 9 > 4, go right of the root and compare the 9 to the 6. Since 9 > 6, go right of the 6 and add the 9 as right child of the 6.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.